package xwj.example.demo.aspect;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
//import org.mybatis.logging.LoggerFactory;
import org.aspectj.lang.annotation.Before;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

//import java.util.logging.Logger;


@Aspect
@Component
public class LogAspect {
    Logger log= LoggerFactory.getLogger(getClass());
    @Before("execution(public * xwj.example.demo.hello.*.*(..))")
    public void beforeDao(JoinPoint joinPoint){
        String info="进入"+joinPoint.getSignature()+"方法,";
        info+="参数是：";
        for(Object arg: joinPoint.getArgs()){
            info+=arg+" ";
        }
        log.info(info);
    }
}
